define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'log/freeze_log/index'
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                search:false,
                columns: [
                    [
                        {field: 'id', title: 'ID',sortable:true},
                        {field: 'user_nickname', title: __('User nickname'),searchable:false},
                        {field: 'operation_nickname', title: __('Operation nickname'),searchable:false},
                        {field: 'user_id', title: __('User ID')},
                        {field: 'operation_id', title: __('Operation user ID')},
                        {field: 'function_text', title: __('Function list'),searchable:false, formatter: Table.api.formatter.label},
                        {field: 'operation_type', title: __('Operation type'),formatter:function(value,row,index){
                            value = value + '';
                            switch (value){
                                case '0':
                                    return __('Freeze');
                                case '1':
                                    return __('Remove freeze');
                                default:
                                    return __('Freeze');
                            }
                        },searchList: {'0': __('Freeze'), '1': __('Remove freeze')}, style: 'min-width:100px;'
                        }
                    ]
                ]
            });
            // 为表格绑定事件
            Table.api.bindevent(table);
        }
    };
    return Controller;
});